package com.zlsy.secondtime.threadcoreknowledge.startthread;

/**
 * @author zhouliang
 * @date 2020/5/14 14:30
 */
public class StartAndRunMethod {

    public static void main(String[] args) {
        Runnable runnable = () -> {
            System.out.println(Thread.currentThread().getName());
        };
        //runnable.run()：
        // main函数会去执行System.out.println(Thread.currentThread().getName());
        //打印出main
        runnable.run();

        Thread thread = new Thread(runnable);
        //新建的这个子线程获取执行System.out.println(Thread.currentThread().getName());
        //打印出Thread-0
        thread.start();
    }
}
